/*
 * Tools.java
 * 
 * Created on 25.6.2007, 15:56:56
 * 
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package VidimAnetky;

import java.util.*;

/**
 *
 * @author Kuba
 */
public class Tools {

    public static Vector splitMeBaby(String input, char delimiter){
        Vector splits = new Vector();
        int start = 0;
        if(input.indexOf(delimiter)>0){
            for(int i=0; i<input.length();i++){
                if(input.charAt(i)==delimiter){
                    String part = input.substring(start, i).trim();
                    if(part.length()>0) splits.addElement(part);
                    start=i+1;
                }
            }
            if(start < input.length())
                splits.addElement(input.substring(start,input.length()));
        }
        return splits;
    }
}
